<form #form="ngForm"  (ngSubmit)="onSubmit(form)">
  <h2>Login</h2>

  <div class="control-row">
    <div class="control no-margin">
      <label for="email">Email</label>
      <input id="email" type="email" name="email" ngModel required email #email="ngModel"/>
    </div>

    <div class="control no-margin">
      <label for="password">Password</label>
      <input id="password" type="password" name="password" ngModel required minlength="6" maxlength="20" #password="ngModel"/>
    </div>

    <button class="button">Login</button>
  </div>

  @if(email.touched && email.dirty && email.invalid ){
    <p class="control-error">
      Invalid email address entered.
    </p>
  }

  @if(password.touched && password.dirty && password.invalid ){
    <p class="control-error">
      Invalid password entered - must be at least 6 characters long.
    </p>
  }

</form>
